A=[1 2 1 0; 5 12 0 1];
Ap=A(1:2,1:2);
A(1,:)=A(1,:)/A(1,1);
A(2,:)=A(2,:)-A(2,1)*A(1,:);
A(2,:)=A(2,:)/A(2,2);
A(1,:)=A(1,:)-A(1,2)*A(2,:);
Bp=A(1:2,3:4);
Ap*Bp
Bp*Ap

Bp*[-1;3]
Bp*[1;-5]
Bp*[2;6]
Bp*[3;5]

A=[1 2 -1 1 2 3; 5 12 3 -5 6 5]
A(1,:)=A(1,:)/A(1,1);
A(2,:)=A(2,:)-A(2,1)*A(1,:);
A(2,:)=A(2,:)/A(2,2);
A(1,:)=A(1,:)-A(1,2)*A(2,:);
A
